<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>test.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--<script type="text/javascript" src="js/javascript.js" ></script>-->
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  <script type="text/javascript" >
  	
  </script>
  <body >
    <div id="p"></div>
    <script type="text/javascript">
/*    	var div=document.getElementById("p");
    	div.innerHTML="<h1>你们好</h1>";
    	if(div.attachEvent){
    		div.attachEvent("onclick",function(event){
    			alert(event);
    			alert(this);
    			event.stopPropagation();
    		});
    	}else{
    		div.addEventListener("click",function(event){
    			alert(event);
    			alert(this);
    		});
    	}
    	function d(){
    		var str="my\\nmat is\\n ddat "
    		var re=/(.{1})\\n/ig;
    		//var array=re.exec(str);
    		//array=re.exec(str);
    		//var str2="pat asdfjiwat";
    		//alert(re.test(str));
    		var array=re.exec(str);
    		alert(RegExp.$1);
    		return array;
    		
    	}
    	
    	function father(name){
		this.name=name;
	}
	function son(age){
		this.age=age;
	}
	var u="prototype";
    	var extentd = function(a, b, c) {
        var d,e,g = a[u];
        e = new Function;
        
        e[u] = b[u];
        
        e = a[u] = new e;
        
        for (d in g) 
        	e[d] = g[d];
        
        a[u].constructor = a;
        a.XA = b[u];
        
        if ("string" == typeof c) 
        	e.Xu = c
    };
    extentd(son,father,"nimei");
    console.log(father);
    console.log(son)*/
    	/*alert(d.toString());
    	alert(Object.prototype.toString.call(d));*/
		//var s=d();    	
    	 	//console.log(event);为什么caonsole输出的事件和当时的事件不一致了?????
	function s(){
    	
	}
    s.prototype.t=(function(){
    	var index=0;
    	return function(){
    		alert(index++);
    	}
    })()
    var p=new s();
    var q=new s();
	    </script>
    
  	<input type="button" onclick="" value="test">  
  	<div id="s"style="position: absolute;background-color:red;width:300px;height:300px;left:100px;top100px"></div> 
  	<script type="text/javascript">
  		var d=document.getElementById("s");
  		d.addEventListener("click",function(){console.log("happen click")});
  		d.addEventListener("mousedown",function(event){console.log("happen down")});
  		d.addEventListener("mouseup",function(){console.log("happen up")});
  	</script>
  </body>
  
</html>
